home *** CD-ROM | disk | FTP | other *** search
- uDTV Hacking
-
- Here are a few pics of my own DTV
- Hummer project. I had an old PSOne LCD
- screen lying around and I thought I'd
- make a C64 laptop. Actually, it's more
- like a C64 PDA! It measures 6.5 x 6 x
- 1.5 inches (15.5 x 16.5 x 4 cm) when
- closed. It can run from an AC wall
- adapter or 6 NiMH AA batteries. The
- keyboard is hacked from a portable
- folding keyboard for a Jornada PDA
- which outputs RS-232. I'm using a PIC
- 16F88 to decode the signals and
- reencode them to PS/2 (that was an
- ordeal to figure out).
-
- The PIC checks to see if an external
- PS/2 keyboard is connected on power
- up. If one is hooked up, it will route
- data from that instead. There is an
- internal ampilfied speaker as well as
- connections for audio and video output
- on the back.
-
- There's a serial connection for a disk
- drive and an SD card slot in the side
- for a 1541-III but I haven't been able
- to get that to work yet. I also have a
- connection for a userport/joystick.
- The joystick in the picture is a
- hacked Atari keychain joystick. The
- mini joystick wasn't in the original
- plan but after I accidentally
- discovered it on ebay, it seemed
- perfect. Here's a how-to post
- regarding the RS232 to PS/2 keyboard
- hack:
-
- http://jledger.proboards19.com/index.c
- gi?board=dtvh
- acking&action=display&thread=116778302
- 4
-
- The Micro Folding Keyboard (Model#:
- TKB420HP) made by Micro Innovations is
- a small portable keyboard for
- attaching to a Jornada PDA. It
- basically has all keys needed for
- adapting to a DTV but unfortunately
- outputs RS-232 instead of PS/2. The
- following information describes how to
- interface this keyboard to DTV Hummer
- and possible the rest of the DTV
- versions. Out of the box:
- Disassembling the keyboard, you'll see
- 5 labeled connections: VCC, RTS, RXD,
- DCD, and GND. VCC is +5V for this
- unit. RXD is the line on which data is
- actually sent, although the keyboard
- won't send anything until RTS is
- pulled high. I do this right on the
- board by soldering a 1k resistor
- between the RTS pad and the onboard
- microcontroller's Vcc pad (see
- picture). By doing this, you only need
- to run three wires from the keyboard
- (VCC, RXD and Ground).
-
- As far as what mechanical
- modificationsE I chose to cut away a
- lot of extra plastic from the two
- folding halves and superglue the sides
- together. This effectively created one
- solid piece. I also glued the
- flexi-ribbon flat against itself to
- take up less space.
-
- Since this keyboard outputs RS-232
- (9600 baud, 8 data bits, 1 stop bit
- and no-parity), a PIC 16F88
- microcontroller is used to convert the
- data to PS/2 for the DTV. PS/2
- keyboards use "make" and "break" codes
-
- One or more "make" codes is sent when
- a key is pressed and several "break"
- codes and are sent on key release. The
- Jornada keyboard kind of works the
- same way in that it uses make and
- break codes, unfortunately the codes
- are not a one for one match and must
- be re-mapped by the PIC.
-
- On power up, the PIC will check to see
- if a regular external PS/2 is
- attached. If so, it will just go into
- "repeater" mode and pass along any
- signals from the PS/2 keyboard to the
- DTV. The PIC adds a one second delay
- to get rid of the pesky "V". Here's
- the circuit:
-
- The diode and resistor on pin 4 are
- for in-circuit serial programming
- (ICSP) and can be left out as well as
- any other connections labeled ICSP.
- The 100k resistor on pin 11 is needed
- even if you decide not to mess with
- the external PS/2 connector, so don't
- leave it out. The rest is fairly
- straight forward. The 100uF cap may
- need to be larger depending on your
- setup. 100uF worked initially for me
- until I added an LCD screen to my
- design. The power surge on start up
- was too much and the keyboard would
- not initialize properly until I
- increased it to 470uF. For timing, the
- internal 8 MHz oscillator is used. It
- seems to work just fine.
-
- Here's the HEX file:
- www.picobay.com/picodore64/JornadaKBD1
- 6F88.he x
-
- And the source code:
- www.picobay.com/picodore64/JornadaKBD1
- 6F88.txt
-
- Again, this is for a 16F88 and any $15
- JDM PIC programmer will work just
- fine. The source code is written in
- PicBasic Pro. The code could probably
- be reduced to half the size by
- constructing the send codes on the fly
- instead of hard coding them. The
- start, stop parity bit could be added
- automatically and each make/break code
- would only take up a byte instead of a
- word. But the 16F88 has 4K of space
- and I wasn't tight on space. Maybe as
- I add more features, I'll recode that
- section. And while I'm at it, I'll
- switch to using interrupts to get the
- data from the Jornada keyboard instead
- of just waiting for data. Obviously
- this is an adapted keyboard and I had
- to switch some of the key assignments:
- Today = ESC (RUNSTOP) Space = INSERT
- Windows key = Commodore Key FN + Right
- Arrow = HOME FN + CRTL + Right Arrow =
- CLR SCN The 4 keys in the top left are
- the F1 thru F4 keys, F5 thru F8 with
- the FN pressed. I didn't bother to
- implement the Numlock keypad, there
- didn't seem to be much point to doing
- so. Just for the heck of it I'm
- posting the PS/2 waveform of a make
- code for the "A" key. Channel 1 is the
- clock and Channel 2 is data. This is
- from a real PS/2 keyboard.
-
- Here are the specs: Mainboard: Hummer
- DTV Construction: Hobby plywood
- covered in faux stainless steel
- contact paper Size: 6.5" x 6" x 1.5"
- (closed) Power: 7.5v wall adapter or 6
- rechargable AA NiMH batteries
-
- Screen: 5" LCD Keyboard: 69-key QWERTY
- Sound: Ampilfied 1.5" 0.4W internal
- speaker Connections: power,
- userport/joystick, serial disk drive,
- audio/video output, headphone jack,
- external PS/2 keyboard, SD card slot.
- Addition peripherals: 1.75" x 1.5"
- mini Atari joystick.
-
- Features: on screen display for volume
- and brightness control, auto sensing
- of external keyboard connection,
- programmable funtion keys, video
- selector switch. Although I plan on
- posting a more length write-up, for
- now, I'll give you just the important
- details: The LCD screen is from a
- PSOne. I'm also using on LCD's board
- audio amp to drive the speaker. The
- LCD is what ultimately drove my power
- requirements. Almost the entire
- circuit for the LCD uses 5v except for
- one IC which needs between 7v and 8v
- to generate H-Sync.
-
- The keyboard was a bitch to figure out
- and will be the subject of a post of
- it's own. It's from a Jornada foldaway
- keyboard made by Micro Innovations. In
- terms of construction, I had cut away
- a lot of extra plastic and superglue
- the two halves together making a
- single solid keyboard.
-
- The keyboard normally interfaces with
- a HP Jornada via a RS-232 link and
- special driver. I was able to capture
- all the output codes and program a
- 16F88 PIC microcontroller to re-map
- and output with the appropriate PS/2
- protocol. On power up, the PIC checks
- if there is an extrenal keyboard
- attached. If so, it ignores data from
- the onboard keyboard.
-
-
- ...end...
-
-